package com.aos.erp.manager.remote.sys;

import com.aos.erp.common.bean.ResultBean;
import com.aos.erp.manager.remote.model.Organization;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @program: erp
 * @description: 同步组织
 * @author: tanzhiyu
 * @create: 2018-11-19 11:18
 **/
@FeignClient(name = "${PERMISSION-SERVICE}"/*, url = "${PERMISSION-SERVICE-URL}"*/)
public interface OrganizationService {
    /**
     * 同步机构
     *
     * @param organization
     * @return
     */
    @PostMapping(value = "/sync/synOrgInfo")
    ResultBean synOrgInfo(@RequestBody Organization organization);

    /**
     * 同步机构删除
     *
     * @param appCode 应用appCode
     * @param code    机构code
     * @return
     */
    @DeleteMapping(value = "/sync/deleteOrg")
    ResultBean deleteOrgInfo(@RequestParam("appCode") String appCode, @RequestParam("code") String code);

    /**
     * 同步根据机构code查角色信息
     *
     * @param organizationCode 机构code
     * @return
     */
    @GetMapping(value = "/sync/queryByOrganizationCode")
    ResultBean queryByOrganizationCode(@RequestParam("organizationCode") String organizationCode);

    /**
     * 根据code查询机构信息
     * @param code  机构code
     * @return
     */
    @GetMapping(value = "/organization/queryByCodes")
    ResultBean queryByCodes(@RequestParam("code") String  code);
}